<template>
  <van-popup custom-class="app_popup_container" :show="show" @close="handleClose">
    <view class="app_popup_content">
      <view class="app_popup_close" @click="handleClose"></view>
      <slot></slot>
    </view>
  </van-popup>
</template>

<script>
export default {
  name: 'app_popup',
  // components: {},
  props: {
    show: Boolean
  },
  data() {
    return {}
  },
  methods: {
    handleClose() {
      // console.log('click close')
      this.$emit('update:show', false)
    }
  }
}
</script>

<style lang="scss">
.app_popup_container {
  background-color: transparent;
  .app_popup_content {
    position: relative;
    width: calc(100vw - 60rpx);
    margin: 0 auto;
    min-height: 400rpx;
    padding: 95rpx 25rpx 40rpx;
    border-radius: 45rpx;
    background-color: #fff;
  }

  .app_popup_close {
    position: absolute;
    z-index: 2;
    top: 25rpx;
    right: 25rpx;
    width: 50rpx;
    height: 50rpx;
    background-image: url('#{$BASEURL}/popup_close.png');
    background-size: contain;
  }
}
</style>
